import request from '@/utils/request'



// 根据教员姓名查询预约列表

export function getApplicationByUserId(userId) {
  return request({
    url: '/application/application/getApplicationByUserId/' + userId,
    method: 'get',
  })
}

// 查询家教申请列表
export function listApplication(query) {
  return request({
    url: '/application/application/list',
    method: 'get',
    params: query
  })
}

// 查询家教申请详细
export function getApplication(applicationId) {
  return request({
    url: '/application/application/' + applicationId,
    method: 'get'
  })
}

// 新增家教申请
export function addApplication(data) {
  return request({
    url: '/application/application',
    method: 'post',
    data: data
  })
}

// 修改家教申请
export function updateApplication(data) {
  return request({
    url: '/application/application',
    method: 'put',
    data: data
  })
}

// 根据 userId 更新教员申请状态为 pending
export function updateApplicationStatusByUserId(userId) {
  return request({
    url: '/application/application/updateStatusByUserId/' + userId,
    method: 'put'
  })
}


// 删除家教申请
export function delApplication(applicationId) {
  return request({
    url: '/application/application/' + applicationId,
    method: 'delete'
  })
}
